{% extends 'home/base.html' %}
{% block title %}Add new stock{% endblock %}
{% block heading %}add new stock{% endblock %}
{% block body %}

    <div class="row">
    <form class="col s12" action='/stock/add_stock/' method="POST">
    {%csrf_token%}
       <div class="row">
    </div>
    <ul>
        <li>
            <div class="input-field col s12">
              <input  type="search" name="target_item" placeholder="默认为全部药品，输入药品关键词以过滤">
              <button type="submit" class="btn">fliter</button>
          </div>
        </li>
    </ul>
    </form>
    </div>

    <div class="row">
    <form class="col s12" action='/stock/do_add_stock/' method="POST">
    {%csrf_token%}
        <div class="row">
    </div>
    <div class="row">
    </div>
        <div class="input-field col s12">
        <select name="item" id="item" class="validate" required>
          {% for items in post_list %}
            <option value='{{items.id}}'>产品名称:{{items.item_name}}--------制造商:{{ items.manufacturer }}</option>
          {% endfor %}
        </select>
      </div>
      <div class="input-field col s12">
        <input type="number" name='quantity' id="quantity" required>
        <label for="quantity" class="active">quantity</label>
      </div>
        <div class="input-field col s6">
        <input type="date" name='purchase_date' id="purchase_date" required>
        <label for="cpurchase_date" class="active">purchase_date</label>
      </div>
      <div class="input-field col s6">
        <input type="date" name='expiry_date' id="expiry_date" required>
        <label for="expiry_date" class="active">expiry_date</label>
      </div>
     <div>
      <button type="submit" class="btn">Add stock</button>
     </div>
  </form>
</div>


{% if post_list %}<div id="item-data" hidden>{% for items in post_list %}"{{items.item_name}}":null, {% endfor %}</div>{% endif %}

{% endblock %}